public class EnumDemo3 {


    public static void main(String[] args) {

        System.out.println(Sex.MALE);

        for (Sex sex:Sex.values()) {
            System.out.println(sex+" "+ sex.getSexName());
        }

        Sex sexV = Sex.valueOf("FEMAIL");

    }

    enum Sex{
        MALE("男"),
        FEMAIL("女"),
        UNKNOW("保密");

        private final String sexName;

        Sex(String sexName){
            this.sexName=sexName;
        }

        public String getSexName(){
            return sexName;
        }
    }

}
